<template>
  <div class="ele-body ele-body-card">
    <a-divider>地址编辑组件示例</a-divider>
    <m-addr-edit
      :AddressEntityData="AddressEntityData"
      :AddressStatus="AddressStatus"
      AddressType="司机"
      @addrChange="getChildData"
    ></m-addr-edit>
    <a-divider>路线规划组件示例</a-divider>
    <m-path-plan></m-path-plan>
  </div>
</template>
<script>
import {defineComponent, reactive, onMounted, ref} from "vue";
import MAddrEdit from "@/components/MAddrEdit/index.vue";
import MPathPlan from "@/components/MPathPlan/index.vue";

export default defineComponent({
  name: "testAddrEdit",
  setup() {
    //TODO  MAddrEdit
    //需要传递给地图组件地址实体数据 默认为空,有值则需要渲染
    let AddressEntityData = reactive({});
    //地址启用状态 "1"  禁用"0"
    let AddressStatus = ref("");

    //停用可编辑 启用不可编辑
    AddressStatus.value = "停用";
    //有值的情况需要查询对应的接口，获取对应的地址实体数据记录 () 参考格式如下
    AddressEntityData = {
      addressAbbreviation: "万凯新都会",
      addressType: "施工部位",
      businessID: 1,
      detailedAddress: "重庆重庆市南岸区南兴路64号",
      province: "重庆",
      city: "重庆市",
      district: "南岸区",
      streetAddress: "南兴路64号",
      addressLongitude: 106.575856,
      addressLatitude: 29.518285,
      zipCode: "4000000",
    };
    //获取子组件传递过来的表单数据。
    let getChildData = (formData) => {
      console.log(formData);
      return formData;
    };
    onMounted(() => {
    });
    //TODO  MPathPlan
    return {
      //TODO  MAddrEdit
      AddressStatus,
      AddressEntityData,
      getChildData,
      //TODO  MPathPlan
    };
  },
  //组件引入
  components: {
    MAddrEdit,
    MPathPlan,
  },
});
</script>
<style scoped>
</style>
